using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Chimera2.Classes
{
    public class Bulletin
    {
        private string bulletinName;
        [XmlAttribute("Username")]
        public string BulletinName
        {
            get { return bulletinName; }
            set { bulletinName = value; }
        }

        private Guid guid;
        [XmlAttribute("GUID")]
        public Guid Guid
        {
            get { return guid; }
            set { guid = value; }
        }

        private bool active;
        [XmlAttribute("Active")]
        public bool Active
        {
            get { return active; }
            set { active = value; }
        }

        private string textCmdName;
        [XmlAttribute("TextCmdName")]
        public string TextCmdName
        {
            get { return textCmdName; }
            set { textCmdName = value; }
        }

        private bool regularCanAdd = true;
        [XmlAttribute("RegularAdd")]
        public bool RegularCanAdd
        {
            get { return regularCanAdd; }
            set { regularCanAdd = value; }
        }

        private bool regularCanEdit = true;
        [XmlAttribute("RegularEdit")]
        public bool RegularCanEdit
        {
            get { return regularCanEdit; }
            set { regularCanEdit = value; }
        }

        private int regularEditMinutes = 60;
        [XmlAttribute("EditMinutes")]
        public int RegularEditMinutes
        {
            get { return regularEditMinutes; }
            set { regularEditMinutes = value; }
        }

        private bool announceNew = true;
        [XmlAttribute("Announce")]
        public bool AnnounceNew
        {
            get { return announceNew; }
            set { announceNew = value; }
        }

        private bool opsAreEditors;
        [XmlAttribute("OpsAreEditors")]
        public bool OpsAreEditors
        {
            get { return opsAreEditors; }
            set { opsAreEditors = value; }
        }

        private List<Guid> accessFrom = new List<Guid>();
        public List<Guid> AccessFrom
        {
            get { return accessFrom; }
            set { accessFrom = value; }
        }

        private bool globalAccess = true;
        [XmlAttribute("Global")]
        public bool GlobalAccess
        {
            get { return globalAccess; }
            set { globalAccess = value; }
        }

        private List<string> editLog = new List<string>();
        public List<string> EditLog
        {
            get { return editLog; }
            set { editLog = value; }
        }

        private List<BulletinPost> posts = new List<BulletinPost>();
        public List<BulletinPost> Posts
        {
            get { return posts; }
            set { posts = value; }
        }

        /// <summary>
        /// Shallow copies the Bulletin instance.
        /// </summary>
        public Bulletin Clone()
        {
            Bulletin b = (Bulletin)MemberwiseClone();

            b.Guid = System.Guid.NewGuid();
            return b;
        }

    }
}
